var expect=require('chai').expect;

var timeout=()=>{
    return new Promise((resolve,reject)=>{
        setTimeout(()=>{
            if(Math.random()<0.5){
                resolve([1,2,3]);
            }else{
                reject(new Error('404'));
            }
        });
    });
}

describe('then(done)',()=>{
    it('match records',(done)=>{
        timeout().then(done)
    });
});